package com.cool.shark.mapper;

import com.cool.shark.pojo.entity.User;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

/**
 * @Name: user
 * @Author: 西风残叶
 * @Date: 2024/3/31 13:38
 * @Version: 1.0
 * @TODO: TODO
 */
@Slf4j
@SpringBootTest
public class user {
    @Autowired
    private UserMapper mapper;

    @Test
    void insert() {
        User user = new User();
        user.setUsername("19948999072");
        user.setPassword("123456");
        log.info("user = {}", user);
        int insert = mapper.insert(user);
        log.info("受影响行数: {}", insert);
    }
    @Test
    void login() {
       String username = "19948999072";
        User byUsername = mapper.getByUsername(username);
        log.info("byUsername = {}", byUsername);
    }
}